window.onload = function(){
    
    document.getElementById("btn1").onclick = function(){
        var num = 3
        function fun(){
            
            if(num == 0){
                location.href = "https://www.baidu.com"
            }else{
                num--
            }
            document.getElementById("time").innerText = num + "秒后开始跳转"
        }
        setInterval(fun, 1000)
        
        
    }

    document.getElementById("btn2").onclick = function(){
        location.reload()
    }

}